#ifndef Project00_H
#define Project00_H

#include "SmallEngine.h"
#include "Sandbox.h"
// #include "ScriptCommon.h"

class Project00 : public Sandbox
{
public:
    Project00(const std::string &name = "Sandbox", CC::Scene* scene = nullptr);
	virtual ~Project00();

	virtual void OnAttach() override;
	virtual void OnDetach() override;

    virtual void OnUpdate(CC::Timestep ts, std::string renderscene = "") override;
    

private:
	glm::vec4 m_ClearColor = {1.0f, 1.0f, 1.0f, 1.0f};

private:

    template <typename T>
    void HandleDeleteLastLayer(std::string title) {
        CC::Application::Get().SubmitToMainThread(CC::ThreadInfo([=](void* param) {
            CC::Application::Get().PopLayer(this);
            delete this;
            }, nullptr));

        CC::Scene* s = new CC::Scene();
        s->LoadFont(PATHCONFIG("assets/fonts/Alimama_DongFangDaKai_Regular.ttf"), "Alimama_DongFangDaKai_Regular");

        CC::Application::Get().SetWindowTitle(title);

        CC::Application::Get().SubmitToMainThread(CC::ThreadInfo([=](void* param) {
            CC::Application::Get().PushLayer((CC::Layer*)new T(title, (CC::Scene*)(param)));
            }, s));
    }


};

#endif